<!DOCTYPE html>
<html>
<head>
    <title><%=title%></title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="stylesheets/public.css">
    <link rel="stylesheet" href="stylesheets/bootstrap.min.css">
    <script src="javascripts/jquery-1.7.1.min.js"></script>
    <script src="javascripts/bootstrap.min.js"></script>

    <script>
        $(function(){
            $('#uname').focus();
            $("#login_btn").keydown(function(event){
                if(event.keyCode == 13){
                    checkLogin();
                }
            });
        });

        function checkLogin(){
            var uname = $('#uname').val();
            var upassword = $('#upassword').val();
            console.log(uname+'    '+upassword)
            if(uname == ""){
                //alert("用户名不能为空");
                return false;
            }else if(upassword == ""){
                //alert("密码不能为空");
                return false;
            }
            $(".login_form").submit();
        }

    </script>

</head>
<body>
<div class="main pagecenter round">
    <div class="page-header">
        <h1 class="h1">服务器管理平台</h1>
        <p>账号sa 密码sa</p>
    </div>
    <form class="login_form" action="/login" method="post">
        <div class="input-group input_size input_margintop">
            <span class="input-group-addon">用户名</span>
            <input id="uname" name="uname" type="text" class="form-control" placeholder="Username">
        </div>
        <br>
        <div class="input-group input_size input_margintop">
            <span class="input-group-addon">密&nbsp;&nbsp;&nbsp;码 </span>
            <input id="upassword" type="password" name="upassword" class="form-control" placeholder="Password">
        </div>
        <br>
        <br><br>
        <p>
           <a id="login_btn" href="javascript:void(0);" class="btn btn-primary login_btn" role="button" onclick="checkLogin();">登录</a>
           <a href="/toRegister" class="btn btn-default reg_btn" role="button">注册</a>
        </p>

    </form>
</div>

</body>
</html>